libxl: get and set soft affinity
authorDario Faggioli <dario.faggioli@citrix.com>
Fri, 20 Jun 2014 16:19:12 +0000 (18:19 +0200)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 27 Jun 2014 12:38:33 +0000 (13:38 +0100)
commit871b43a309d80ac99458c13c2c3da8d15c482d30
treed5252a07af799ba6ae77140025d7ff2cdd3cc82c
parent6cc89d3101d8874e01a69a89a65736a2adfbd199
libxl: get and set soft affinity

Make space a new cpumap in vcpu_info, called cpumap_soft,
for retrieving soft affinity, and amend the relevant API
accordingly.

libxl_set_vcpuaffinity() now takes two cpumaps, one for hard
and one for soft affinity (LIBXL_API_VERSION is exploited to
retain source level backword compatibility). Either of the
two cpumap can be NULL, in which case, only the affinity
corresponding to the non-NULL cpumap will be affected.

Getting soft affinity happens indirectly (see, e.g.,
`xl vcpu-list'), as it is already for hard affinity).

This commit also introduces some logic to check whether the
affinity which will be used by Xen to schedule the vCPU(s)
does actually match with the cpumaps provided. In fact, we
want to allow every possible combination of hard and soft
affinity to be set, but we warn the user upon particularly
weird situations (e.g., hard and soft being disjoint sets
of pCPUs).

This very change also update the error handling for calls
to libxl_set_vcpuaffinity() in xl, as that can now be any
libxl error code, not just only -1.

Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Reviewed-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl.c
tools/libxl/libxl.h
tools/libxl/libxl_dom.c
tools/libxl/libxl_types.idl
tools/libxl/libxl_utils.h
tools/libxl/xl_cmdimpl.c